package cn.llssit.controller;

import cn.llssit.framework.web.controller.BaseController;
import cn.llssit.framework.web.domain.AjaxResult;
import cn.llssit.project.wechatapi.domain.Orders_Detail;
import cn.llssit.project.wechatapi.mapper.OrdersMapper;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: Lesan
 * @Date: 2020-07-04
 */
@RestController
@RequestMapping("/orders")
public class OrdersController extends BaseController {
    @Autowired
    private OrdersMapper ordersMapper;

    @ApiOperation("")
    @GetMapping("/list")
    public AjaxResult getList(Integer pageNum, Integer pageSize,String date,String name,String phone){
        startPage();
        List<Orders_Detail> orders_details = ordersMapper.selectOrderList(date,phone,name!=null?name+"%":null);
        return AjaxResult.success(getDataTable(orders_details));
    }
}
